<?php
/************************************************************************
 Omnitrix - PHP Development Framework
 Copyright (C) 2012-2018 amonest(eastson@outlook.com)

 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.
************************************************************************/

abstract class omnitrix_module
{
	public $module_id;
	public $module_name;
	public $module_path;
	public $module_status;
	protected $_language;

	protected function _($key, $args = array())
	{
		if (null === $this->_language) {
			$class_name = get_class($this);
			$module_name = substr($class_name, 0, strlen($class_name) - 7);
			$this->_language = otx_language_load('module', $module_name, false);
		}

		if (true === $key) {
			$this->_language = array_merge($this->_language, (array) $args);
			return $this->_language;
		}

		if (array_key_exists($key, $this->_language)) {
			return otx_string_parse($this->_language[$key], $args);
		}

		return otx_language_parse($key, $args);
	}

	public function navmenu()
	{
		return array();
	}

	public function activate() {}
	public function deactivate() {}
	public function install() {}
	public function uninstall() {}
	abstract public function get_info();
}